package com.cy.model;

import com.cy.BasicModel;
import com.cy.ext.plugin.tablebind.TableBind;

import java.util.List;

@TableBind(tableName="device_map_tag")
public class DeviceMapTag extends BasicModel<DeviceMapTag> {
    public static final DeviceMapTag dao = new DeviceMapTag();
    public static final String SELECT_ALL = "`device_id`,`tag_id`";
            
    public DeviceMapTag setDeviceId(Long deviceId){
        return this.set("device_id",deviceId);
    }

    public Long getDeviceId(){
        return this.get("device_id");
    }
        
    public DeviceMapTag setTagId(Long tagId){
        return this.set("tag_id",tagId);
    }

    public Long getTagId(){
        return this.get("tag_id");
    }

    public List<DeviceMapTag> findByTag(Long tagId) {
        return DeviceMapTag.dao.find("select * from device_map_tag where tag_id = ?", tagId);
    }
}
